<div>
  <div class="pull-right">
    <%= link_to "新建百科分类", new_admin_wiki_category_path, class: "btn btn-primary" %>
  </div>

  <h1>
    <% if @wiki_category %>
      百科分类:<%= @wiki_category.title %>(<%= @wiki_categories.total_entries %>)
    <% else %>
      百科分类(<%= @wiki_categories.total_entries %>)
    <% end -%>
  </h1>
</div>

<div>
  <table class="table table-striped">
    <tr>
      <th>ID</th>
      <th>名称</th>
      <th>Weight</th>
      <th></th>
    </tr>

    <% @wiki_categories.each do |wiki_category| %>
      <tr>
        <td><%= wiki_category.id %></td>
        <td>
          <%= wiki_category.title %>
        </td>
        <td><%= wiki_category.weight %></td>
        <td align="right">
          <%= link_to "编辑", edit_admin_wiki_category_path(wiki_category) %>
          <%= link_to "删除", admin_wiki_category_path(wiki_category), method: :delete, 'data-confirm': "确认删除吗?" %>
        </td>
      </tr>
    <% end -%>
  </table>

  <%= will_paginate @wiki_categories %>
</div>
